package com.chance.cc.crawler.prod.command.trigger.domain.news.iqiyi;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.iqiyi.searchKw.IQiYiRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.iqiyi.searchKw.IQiYiTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.iqiyi.searchKw.IQiYiTraceTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2020-12-09 16:15:28
 * @email okprog@sina.com
 */
public class IQiYiCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
        publishIQiYiSearchKwRealtimeCrawlerScheduleTriggerInfo();
        publishIQiYiSearchKwTraceCrawlerScheduleTriggerInfo();
        publishIQiYiSearchKwTraceTraceCrawlerScheduleTriggerInfo();
    }

    public static void publishIQiYiSearchKwRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = IQiYiRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                IQiYiRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/20 * * * ?",
                "爱奇艺实时采集任务执行，每20分钟执行一次"
        );
    }

    public static void publishIQiYiSearchKwTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = IQiYiTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                IQiYiTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "爱奇艺回溯采集任务执行，每一个小时执行一次"
        );
    }

    public static void publishIQiYiSearchKwTraceTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = IQiYiTraceTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                IQiYiTraceTraceCrawlerSchedulerJob.domain,
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
//                "",
                "爱奇艺回溯7天采集任务执行，每天凌晨1点执行"
        );
    }
}
